package top.yunmouren.areamusic.commannd.Adventure;

import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.event.HoverEvent;
import net.kyori.adventure.text.format.Style;
import net.kyori.adventure.text.format.TextDecoration;
import top.yunmouren.areamusic.config.MusicDto;

import static net.kyori.adventure.text.format.NamedTextColor.WHITE;

public class MusicListMessage {
    public static TextComponent.Builder handleListMusic(MusicDto MusicDto){
       TextComponent.Builder append = Component.text();
       append.append(Component.text(MusicDto.getMusicId(),Style.style(TextDecoration.UNDERLINED, WHITE)));
       append.hoverEvent(HoverEvent.showText(
               Component.text("音乐插件内部 ID: " + MusicDto.getUuid() + "\n音乐的客户端 ID: " + MusicDto.getMusicURL() + "\n音乐的持续时间: " + MusicDto.getMusicDuration() + " s")
       ));
       return append;
    }
}
